﻿@model RBS.Core.Model.P_Advertis_Payment
@{
    ViewBag.Title = "优惠券管理";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
     
   @* <script>
        $(document).ready(function () {
            $(".tab-contentaaa").hide();
            $(".tab-contentaaa").eq($(".ddd[checked]").val() - 1).show();
            $(".ddd").bind("click",function() { 
                //根据参数决定显示内容
                $(".tab-contentaaa").hide();
                $(".tab-contentaaa").eq(this.value-1).show();
            }); 
        }); 
    </script> *@
}
<!--导航栏-->
<div class="location">
    <a href="javascript:history.back(-1);" class="back"><i></i><span>返回列表页</span></a>
    <a href="@Url.Action("Main", "Home")" class="home"><i></i><span>首页</span></a>
    <i class="arrow"></i>
    <span>@ViewBag.Title</span>
</div>
<!--/导航栏--> 
<!--内容-->
<div class="content-tab-wrap">
    <div id="floatHead" class="content-tab">
        <div class="content-tab-ul-wrap">
            <ul>
                <li><a href="javascript:;" onclick="tabs(this);" class="selected">@ViewBag.Title</a></li>
            </ul>
        </div>
    </div>
</div>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true) 
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.HotelId) 
    @Html.HiddenFor(model => model.UserId) 
    @Html.HiddenFor(model => model.CreateTime) 
    <div class="tab-content">
        <dl>
            <dt>优惠券类型</dt>
            <dd>
                <div class="rule-multi-radio deedtype">
                    <label for="DeedType">送菜券</label>
                    @Html.RadioButtonFor(model => model.DeedType, 1, new { @id = "radio1" ,@class="ddd" })
                    <label for="DeedType">消费券</label>
                    @Html.RadioButtonFor(model => model.DeedType, 2, new { @id = "radio2"  ,@class="ddd"})
                    <label for="DeedType">广告券</label>
                    @Html.RadioButtonFor(model => model.DeedType, 3, new { @id = "radio3"  ,@class="ddd"})
                </div>
                <span class="Validform_checktip">*</span>
            </dd>
        </dl>  
        <dl>
            <dt>优惠卷名称</dt>
            <dd>
                @Html.TextBoxFor(model => model.Crowd, null, new { @class = "input normal",datatype="s2-8" })
                <span class="Validform_checktip">*</span> 
            </dd>
        </dl>
        <dl id="dlDenomination"> 
            <dt id="labDenomination">面额</dt>
            <dd> 
                @Html.TextBoxFor(model => model.Denomination, null, new { @class = "input small", datatype = "n", nullmsg="请输入面额" })
                <span class="Validform_checktip" id="tipDenomination">*请输入面额</span>
            </dd>
        </dl> 
        <dl id="dlDenomination1"> 
            <dt  >菜品名称</dt>
            <dd>
                @Html.TextBox("DenominationDesc", null, new { @class = "input normal", datatype = "*", nullmsg="请选择菜品" })  
                 <a id='selectCoocBook' href='javascript:;' onclick='selectCoocBook()'>选择</a>
            </dd>
        </dl> 
        <dl>
            <dt>发行数量</dt>
            <dd>
                @Html.TextBoxFor(model => model.Quantity, null, new { @class = "input small", datatype = "n", nullmsg="请输入发行数量" })
                <span class="Validform_checktip">*数量</span>
            </dd>
        </dl>
        <dl>
            <dt>有效期</dt>
            <dd>
                @Html.TextBoxFor(model => model.ValidStartTime, String.Format("{0:yyyy-MM-dd}", Model.ValidStartTime), new { @class = "input date", onfocus = "WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-{%d+1}'})", onchange = "javascript:ValidEndTime.focus()", datatype = @"/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}$/", errormsg = "请选择正确的日期", sucmsg = " ", width = "100px" })
                @Html.TextBoxFor(model => model.ValidEndTime, String.Format("{0:yyyy-MM-dd}", Model.ValidEndTime), new { @class = "input date", onfocus = "WdatePicker({dateFmt:'yyyy-MM-dd',minDate:\"#F{$dp.$D(\'ValidStartTime\')}\"})", datatype = @"/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}$/", errormsg = "请选择正确的日期", sucmsg = " ", width = "100px" })
                <span class="Validform_checktip">*有效期</span>
            </dd>
        </dl> 
        <dl>
            <dt>获取规则</dt>
            <dd>消费满 @Html.TextBoxFor(model => model.AccessRules, null, new { @class = "input small", datatype = "n" }) 元赠送 
                <span class="Validform_checktip">*</span> 
            </dd>
        </dl>  
        <dl>
            <dt>使用规则</dt>
            <dd>消费满 @Html.TextBoxFor(model => model.UseRules, null, new { @class = "input small", datatype = "n" })  元使用
                <span class="Validform_checktip">*使用规则</span> 
            </dd>
        </dl> 
        <dl style="display: none">
            <dt>是否跨酒店使用</dt>
            <dd>
                <div class="rule-multi-radio">
                    <label for="IsCrossHotel">否</label>
                    @Html.RadioButtonFor(model => model.IsCrossHotel, 0, new { @id = "radio1", @name = "rdolstState", @checked = "checked" })
                    <label for="IsCrossHotel">是</label>
                    @Html.RadioButtonFor(model => model.IsCrossHotel, 1, new { @id = "radio2", @name = "rdolstState" })
                </div> 
                <span class="Validform_checktip">*</span> 
            </dd>
        </dl> 
    </div>
    <!--/内容--> 
    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-list">
            <input type="submit" value="提交保存" class="btn" />
            <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" /> 
        </div>
        <div class="clear"></div>
    </div>
    <!--/工具栏--> 
    <script>
        $(function () { 
            //$("input[name=DeedType]").attr("disabled", "disabled");
            SetSC($('input[name=DeedType][checked]').val()); 
            $(".deedtype input").click(function() { 
                SetSC(this.value);
            }); 
        }); 
        function SetSC(o) { 
            if (o == 1) {
                $("#dlDenomination1").show(); 
                $("#dlDenomination").hide();
                $("#DenominationDesc").attr("datatype", "*");
                GetCookbook($("#Denomination").val());
            } else {
                $("#dlDenomination").show(); 
                $("#dlDenomination1").hide(); 
                $("#DenominationDesc").attr("datatype", "s0-28");
            } 
        } 
        function selectCoocBook() { 
            ad1 = dialog("newbooks", "选择赠送菜品", "../Cookbook/SelectCookBook");
        } 
        function dialog(id, title, url) {
            abc = $.dialog({
                id: id, lock: true, title: title, width: '710px', height: '520px', content: "url:" + url
            });
            return abc;
        } 
        function GetCookbook(id) {
            $.get("@Url.Action("GetCookBook")?cid=" + id, function (result) { 
                $("#DenominationDesc").val(result.Data); 
            });  
        }
        
    </script>  
}










